import notFoundImg from '@/assets/images/nocourse.png'
import { PrepaidCardInfo } from '@/types/orderConfirm'
import { getUserSelectList, getConfirmUpdatePrice } from '@/api/prepaidCard'
import PrepaidCard from './prepaidCardSelect'
import React, { FC, useEffect, useState } from 'react'
import { useAsyncEffect } from 'ahooks'
import { XBusinesslineId } from '@/constants'
import { CourseId } from '@/types'
import { ResPrepaidCard } from '@/types/prepaidCard'
import { Product } from '@/types/product'

const payAttention: FC<{
  prepaidCardInfo: Partial<PrepaidCardInfo>
  course_id: CourseId
  balance: string | number
  productInfo: Product[]
}> = (props) => {
  // 注：若商品申请退费时讲义已签收，需根据签收的讲义按分类扣除费用。

  const [select, setSelect] = useState(false)

  return (
    <>
      <div className=" w-full clear-both leading-r1.6  text-gray-333333 text-r1.4 font-normal pt-r1.3  overflow-hidden ">
        <span className=" float-left ">礼品卡</span>
        <span
          className=" float-right font-medium text-gray-999999 leading-r1.2 text-r1.2 "
          onClick={() => {
            setSelect(true)
          }}
        >
          {props.prepaidCardInfo?.repaidCardDesc}
          <i className="  iconfont icon-icon_arrow_right relative top-r0.2 "></i>
        </span>
      </div>
      {select ? (
        <PrepaidCard
          balance={props.balance}
          productInfo={props.productInfo}
          course_id={props.course_id}
          setVisible={setSelect}
        ></PrepaidCard>
      ) : null}
    </>
  )
}

export default payAttention
